home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / splotch.zip / SPLOTCH.DOC < prev    next >
Text File  |  1991-09-29  |  2KB  |  56 lines

  1.                             +------------------------+
  2.                             | SPLOTCH  by Bill Reamy |
  3.                             +------------------------+
  4.  
  5.   - An example of cellular automata.
  6.   - With Turbo Pascal source.
  7.   - VGA required.
  8.  
  9.    note: unlike "Life" and many other examples, Splotch has changes that
  10.          occur one at a time, instead of an entrie 'generation' at a time.
  11.  
  12.    This program is loosly based on "Vote", ( no I don't remember who wrote
  13.    it, I just remember reading about it in a computer magazine).
  14.  
  15.    This program should compile under Turbo Pascal ver 5.0, 5.5, or 6.0.
  16.  
  17.    The file Vga256.bgi must be present in the current directory.
  18.  
  19.    Splotch starts out with random screen. Each pixel is randomly colored.
  20.    Then one by one, pixels are averaged with one of their neighbors.
  21.    Which pixels are chosen, and which neighbor is used, is determined
  22.    by a pseudo-random number generator. The end result is that all pixels
  23.    will (probablly) eventualy become the same color. Along the way, areas
  24.    on the screen will form, in different colors, one fading into the next.
  25.  
  26.    Be PATIENT, this will take some time. Noticable changes start within
  27.    2 to 3 minutes on a 12MHz 286. A full run will take well over an hour.
  28.    This program is good for those times when you are reading a book, and
  29.    you don't bother to turn off the computer.
  30.  
  31.    If you'd like a change of colors, turning 'Scroll-Lock' on will
  32.    cause VGA palette rotation. If you leave it rotating, the pattern will
  33.    not progress.
  34.  
  35.    I included the source because this is the sort of program that is fun
  36.    to modify. Try changing the starting screen, pixel influence expression,
  37.    etc.
  38.  
  39.    For an interesting variation try replacing the following code, which
  40.    fills the screen with random dots:
  41.   for X := 0 to 319 do
  42.     for Y := 0 to 199 do
  43.       PutPixel( X, Y, Random(256) );}
  44.  
  45.    Instead try this, it will fill the screen with random rectangles:
  46.  for R := 1 to 200
  47.    do begin
  48.       X := Random( 300 );
  49.       Y := Random( 180 );
  50.       SetFillStyle( SolidFill, Random(256) );
  51.       Bar( X,Y, X+Random(318-X), Y+Random(198-Y) );
  52.       end;
  53.  
  54.  
  55.  
  56.